package com.ruoyi.camp.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.camp.mapper.CDetailsMapper;
import com.ruoyi.camp.domain.CDetails;
import com.ruoyi.camp.service.ICDetailsService;

/**
 * 详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-26
 */
@Service
public class CDetailsServiceImpl implements ICDetailsService
{
    @Autowired
    private CDetailsMapper cDetailsMapper;

    /**
     * 查询详情
     *
     * @param detailid 详情主键
     * @return 详情
     */
    @Override
    public CDetails selectCDetailsByDetailid(String detailid)
    {
        return cDetailsMapper.selectCDetailsByDetailid(detailid);
    }

    /**
     * 查询详情列表
     *
     * @param cDetails 详情
     * @return 详情
     */
    @Override
    public List<CDetails> selectCDetailsList(CDetails cDetails)
    {
        return cDetailsMapper.selectCDetailsList(cDetails);
    }

    /**
     * 新增详情
     *
     * @param cDetails 详情
     * @return 结果
     */
    @Override
    public int insertCDetails(CDetails cDetails)
    {
        cDetails.setDetailid(IdUtils.randomUUID());
        return cDetailsMapper.insertCDetails(cDetails);
    }

    /**
     * 修改详情
     *
     * @param cDetails 详情
     * @return 结果
     */
    @Override
    public int updateCDetails(CDetails cDetails)
    {
        return cDetailsMapper.updateCDetails(cDetails);
    }

    /**
     * 批量删除详情
     *
     * @param detailids 需要删除的详情主键
     * @return 结果
     */
    @Override
    public int deleteCDetailsByDetailids(String[] detailids)
    {
        return cDetailsMapper.deleteCDetailsByDetailids(detailids);
    }

    /**
     * 删除详情信息
     *
     * @param detailid 详情主键
     * @return 结果
     */
    @Override
    public int deleteCDetailsByDetailid(String detailid)
    {
        return cDetailsMapper.deleteCDetailsByDetailid(detailid);
    }
    @Override
    public int deleteDetailsByAppointid(String appointid)
    {
        return cDetailsMapper.deleteDetailsByAppointid(appointid);
    }
}
